home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 April: Mac OS SDK / Dev.CD Apr 97 SDK1.toast / Development Kits (Disc 1) / Apple Guide / Authoring / Documentation / Example Source Files Appdx C / Event functions SW.src < prev    next >
Encoding:
Text File  |  1994-09-27  |  1.7 KB  |  45 lines  |  [TEXT/ttxt]

  1. #SurfWriter-specific event functions
  2.  
  3. #Event functions can be specified in any of these commands:
  4. # <Standard Button>, <3D Button>, <Define Nav Button>,
  5. # <Hot Object>, <Hot Text>, <Hot Rectangle>,
  6. # <On Panel Show>, <On Panel Hide>, <On Panel Create>, <On Panel Destroy>
  7.  
  8. #You can use event functions that you define yourself or use any of the
  9. # built-in event functions (such as DoAppleScript or LaunchNewSequenceNewWindow)
  10. #This guide file mainly uses DoAppleScript, 
  11. # but also defines some of its own event functions.
  12.  
  13. #You typically define an event function for use in 
  14. # Continue panels to perform an action for the user;
  15. # in this case you typically specify the event function in <On Panel Show> commands
  16.  
  17. # *******************************************************
  18. #examples of how to define an event function
  19.  
  20. #send an Apple event with event class 'aevt' and event ID 'xxxx'
  21. # to the application with signature 'WAVE'
  22. <Define Event> "doNothingEvent", 'WAVE', 'aevt', 'xxxx'
  23.  
  24. #define event function with name "SWOpenDictionary" for the
  25. # application with signature 'WAVE'
  26. #the event class is 'aevt' and event ID is 'odoc'  
  27. #Because this event expects only one parameter (the direct parameter)
  28. # and the keyword for this parameter is other than 'IOPT', the 
  29. # fifth parameter (data for the IOPT parameter) is unused.
  30. #This event function uses the sixth parameter to specify the
  31. #  keyword for the direct object ('----') and the caller of this
  32. # event function provides the data for the direct object.
  33. #When the SurfWriter application receives this type of event, it opens
  34. # the document (a dictionary) specified by the caller
  35. <Define Event> "SWOpenDictionary", 'WAVE', 'aevt', 'odoc' ,,'----'
  36.  
  37. #example use:
  38. #<On Panel Show> SWOpenDictionary("Site Dictionary")
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.